import { useState, useEffect } from 'react'
import { View } from '@tarojs/components'
import Taro, { } from '@tarojs/taro'

export default function Index({ children }) {
    const [safeArea, setSafeArea] = useState<any>({})
    useEffect(() => {
        const systemInfo = Taro.getSystemInfoSync()
        setSafeArea({
            statusBarHeight: systemInfo.statusBarHeight,
        })
    }, [])
    return (
        <View style={{ paddingTop: `${safeArea.statusBarHeight}px` }}>
            {children}
        </View>
    )
}
